<%@page import="dao.ClientDAO"%>
<%@page import="bean.Bean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ include file="session.jsp" %>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="images/main.css" rel="stylesheet" type="text/css">


</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF">
<br>
   
      <table width="98%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="10"  class="optiontitle">客户列表</td>
        </tr>
        <%
        	Bean bean = new Bean();
			ClientDAO dao = new ClientDAO();
			List list = new ArrayList();
			list=dao.list();
			if(list.size()==0){
         %>
          <tr align="center" bgcolor="#ffffff">
         <td colspan="10">对不起！目前数据库中还没有添加客户！</td>
        </tr>
        <%}else{ %>
        <tr align="center" bgcolor="#ebf0f7">
		  <td width="40">编号</td>
          <td width="10%">姓名</td>
          <td width="10%">电话</td>
          <td width="10%">电子邮件</td>
          <td width="">描述</td>
          <td width="20%">执行操作</td>
        </tr>
		<%
			for(int i=0; i<list.size();i++){
				bean=(Bean)list.get(i);
				
		 %>
		
        <tr align='center' bgcolor='#FFFFFF' onmouseover='this.style.background="#F2FDFF"' onmouseout='this.style.background="#FFFFFF"'>
		  <td><%=bean.getId() %></td>
		  <td><%=bean.getName() %></td>
		  <td><%=bean.getPhone() %></td>
		  <td><%=bean.getMail() %></td>
		  <td><%=bean.getDescription() %></td>
          <td>
          		<!--  
          		<IMG src="images/view.gif" align="absmiddle"><a href="staff_view.jsp?id=<%=bean.getId() %>">详细</a> 
          		-->
          		<IMG src="images/edit.gif" align="absmiddle"><a href="client_edit.jsp?id=<%=bean.getId() %>">修改</a> 
          		<IMG src="images/drop.gif" align="absmiddle"><a onclick="return confirm('确实要删除！');" href="../ClientServlet?kind=3&id=<%=bean.getId() %>">删除</a></td>
        </tr>
		<%} }%>
		<tr bgcolor="#ebf0f7">
		  <td colspan="10" height="30">&nbsp;&nbsp;
		  </td>
		</tr>
   


      </table>
	  <br>

    </td>
  </tr>
</table>
</body>
</html>